Passed
Push — feat/issue-2 ( 645a56...415766 )
by Yuri
01:38
created

index.ts ➔ createSortedObject   A

Complexity

Conditions 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 9
dl 0
loc 11
ccs 2
cts 2
cp 1
crap 1
rs 9.95
c 0
b 0
f 0
1
import { SortOptions } from './types';
2 1
import { sortRecursively } from './core';
3
4 1
export function sort<T>(
5
  data: T,
6
  ascending = true,
7
  sortPrimitiveArrays = false
8
): T {
9 82
  const options: SortOptions = { ascending, sortPrimitiveArrays };
10 82
  return sortRecursively(data, options);
11
}
12
13
// Re-export types for convenience
14
export type {
15
  SortOptions,
16
  ObjectType,
17
  SortedEntry,
18
  NonSortableType,
19
} from './types';
20